<?
	$action = $_REQUEST["action"];
	$id = $_REQUEST["id"];
	switch($action) {
		case "enable":
		{
			$sqlUpdate = "UPDATE congvan SET status = 1 WHERE idcongvan = $id";	
			$query = mysql_query($sqlUpdate) or die("can not enable status congvan");
			echo "<script>alert('Kích hoạt thành công');</script>";		
			echo "<script> location='?go=congvan&action=view&page=1';</script>";
		}
		break;
		case "disable":
		{
			$sqlUpdate = "UPDATE congvan SET status = 0 WHERE idcongvan = $id";	
			$query = mysql_query($sqlUpdate) or die("can not disable status congvan");
			echo "<script>alert('Vô hiệu hóa thành công');</script>";	
			echo "<script> location='?go=congvan&action=view&page=1';</script>";
		}
		break;
	}
?>